package com.tiancheng.trade.settlement.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 订单支付状态枚举
 *
 * @author lkl
 * @date 2021/3/19
 */
@Getter
@AllArgsConstructor
public enum OrderPayStatusEnum implements BaseEnum<String> {

    un_pay("UP", "未支付"),
    paid("AP", "已支付");

    private String code;
    private String desc;

    public static String getDesc(String code) {
        OrderPayStatusEnum[] businessModeEnums = values();
        for (OrderPayStatusEnum statusEnum : businessModeEnums) {
            if (statusEnum.code().equals(code)) {
                return statusEnum.desc();
            }
        }
        return code;
    }

    public String code() {
        return this.code;
    }

    public String desc() {
        return this.desc;
    }
}
